#!/usr/bin/env python
# encoding: utf-8

import logging
import os
import picasa
import sys
import getopt

options, sys.argv[1:] = getopt.getopt(sys.argv[1:], '',
                                      ["email=",
                                      "password=",
                                      "cookie="])
options = dict(options)

logging.basicConfig(level=logging.INFO,
                    format='%(asctime)s %(levelname)s %(message)s')

def Account(singleton=[]):
  if not singleton:
    acc = picasa.Account(options["--email"], options["--password"])
    singleton.append(acc)
  return singleton[0]

def Cookie():
  return options["--cookie"]
